package com.example.demo.topic.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 发帖管理表;
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Data
public class TNoteManage implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 图片
     */
    @TableField("IMG")
    private String img;

    /**
     * 标题
     */
    @TableField("TITLE")
    private String title;

    /**
     * 文本
     */
    @TableField("TEXT")
    private String text;

    /**
     * 视频
     */
    @TableField("VIEW")
    private String view;

    /**
     * 作者;外键关联服务端人员表
     */
    @TableField("MASTER_ID")
    private String masterId;

    /**
     * 所属账号;外键关联账号主体表
     */
    @TableField("ACCOUNT")
    private String account;

    /**
     * 类型
     */
    @TableField("TYPE")
    private String type;

    /**
     * 包含话题;外键关联话题表
     */
    @TableField("TOPIC")
    private String topic;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value="CREATED_TIME",fill = FieldFill.INSERT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value="UPDATED_TIME",fill = FieldFill.UPDATE)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "TNoteManage{" +
        "id=" + id +
        ", img=" + img +
        ", title=" + title +
        ", text=" + text +
        ", view=" + view +
        ", author=" + masterId +
        ", account=" + account +
        ", type=" + type +
        ", topic=" + topic +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        "}";
    }

    //发帖数量
    @TableField(exist = false)
    private Integer postNum;
}
